<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>SOP</title>
<link href="resources/styles/main.css" rel="stylesheet" type="text/css" />
<link type="text/css" href="resources/scripts/jquery-ui-1.8.14.custom/css/start/jquery-ui-1.8.14.custom.css" rel="stylesheet" />
<script type="text/javascript" src="resources/scripts/jquery-ui-1.8.14.custom/js/jquery-1.5.1.min.js"></script>
<script type="text/javascript" src="resources/scripts/jquery-ui-1.8.14.custom/js/jquery-ui-1.8.14.custom.min.js"></script>
<script type="text/javascript" src="resources/scripts/jquery-ui-1.8.14.custom/js/jquery.blockUI.js"></script>
<script type="text/javascript" src="resources/scripts/datepicker-CN.js"></script>

<link href="resources/scripts/valums/client/fileuploader.css" rel="stylesheet" type="text/css">	
<script src="resources/scripts/valums/client/fileuploader.js" type="text/javascript"></script>

<script type="text/javascript">


function checkFields()
{
	
	if($('#theme').val() == '' )
	{
		alert('请填写活动主题');
		return false;
	}
	if($('#r3').val() == '' )
	{
		alert('请填写活动主题');
		return false;
	}
	if($('#r5').val() == '' )
	{
		alert('请填写活动人数');
		return false;
	}
	if($('#cdate').val() == '' )
	{
		alert('请填写活动日期');
		return false;
	}
	if($('#filename').val() == '' )
	{
		alert('请上传附件');
		return false;
	}
	if($('#r1').val() == -1 )
	{
		alert('请选择活动类型');
		return false;
	}
	return true;
}


$(document).ready(function(){
	
	
	var success = '<!--{$success}-->';
	if(success=='1')
		alert('提交成功');
	else if(success=='-1')
		alert('提交失败，请稍候重试');
	
	
	$( "#cdate" ).datepicker();
	$('.submitForm').click(function(){
		if(!checkFields())
		{
			return false;
		}
		$('#addActionForm').submit();
	});
	
	var uploader = new qq.FileUploader({
		element: $('#file-upload-1')[0],
		action: 'resources/scripts/valums/server/php.php',
		debug: false,
		allowedExtensions: ['ppt'],
		onComplete: function(id, filename, responseJSON){
				var fullPath = responseJSON['fullPath'];
				fullPath = 'resources/scripts/valums/server/'+fullPath;
				$('#filename').val(filename);
				$('#fullPath').val(fullPath);
		}   
	});
	
				
	$('#repwdMy').dialog({ 
	autoOpen: false,
	buttons: {
			"提交": function() {
					if(!checkUsername($('#oldpwdMy').val()))
					{
						$('#errMsgRepwdMy').html('密码不能为空');
						return;
					}
					if(!(checkUsername($('#repwdInputMy').val())))
					{
						$('#errMsgRepwdMy').html('密码不能为空');
						return;
					}
					if($('#repwdInputMy').val() != $('#repwdInputConfirmMy').val())
					{
						$('#errMsgRepwdMy').html('密码和确认密码不一致');
						return;
					}
					$('#errMsgRepwdMy').html('<span style="color: green;"></span>');
					$.post(
						'<!--{spUrl c=main a=changeMyPwd}-->',
						{
							'oldpwd': $('#oldpwdMy').val(),
							'pwd': $('#repwdInputMy').val(),
							'selectedUser' : "<!--{$user.id}-->"
						},
						function(data) {
							if(data == -1)
							{
								$('#errMsgRepwdMy').html('密码错误');
								return;
							}
							alert('密码修改成功');
							window.location.reload();
						}
					);
				},
			"关闭": function() {
					$(this).dialog('close');
				}
		}
	});
	
	$('.repwdLinkMy').click(function(){
		$('#repwdMy').dialog('open');
		return false;
	});
	
	$("#cdate").change(function(){
		window.location.href="<!--{spUrl c=unit_import a=part3}-->"+"&cdate="+$('#cdate').val()+"&r1="+$('#r1').val();
	});
	
	$('#r3').html($('#group_'+$('#r1').val()).html());
	
	$('#r1').change(function(){
		window.location.href="<!--{spUrl c=unit_import a=part3}-->"+"&cdate="+$('#cdate').val()+"&r1="+$('#r1').val();
		$('#r3').html($('#group_'+$(this).val()).html());
	});
	
});
</script>

<style>
div.ui-datepicker{
 font-size:10px;
}
</style>

</head>

<body>
<div class="hiddenOptions" style="display: none;">
	<!--{foreach from=$config02 item=group}-->
    	<div id="group_<!--{$group.id}-->" style="display: none;">
        	<!--{foreach from=$group.options item=one}-->
        		<option value="<!--{$one}-->" <!--{if $one==$data.r3}-->selected="selected"<!--{/if}-->><!--{$one}--></option>
            <!--{/foreach}-->
        </div>
    </div>
    <!--{/foreach}-->
</div>
<div id="repwdMy" style="width: 320px; height: 240px; display:none;">
  <form method="POST">
    <table>
      <tr>
      	<td colspan="2"><span style="color: #900; " id="errMsgRepwdMy"></span></td>
      </tr>
      <tr>
        <td>旧密码：</td>
        <td><input id="oldpwdMy" type="password" name="oldpwdMy"/></td>
      </tr>
      <tr>
        <td>新密码：</td>
        <td><input id="repwdInputMy" type="password" name="repwdInputMy" /></td>
      </tr>
      <tr>
        <td>重复新密码：</td>
        <td><input id="repwdInputConfirmMy" type="password" name="repwdInputConfirmMy" /></td>
      </tr>
    </table>
  </form>
</div>
<table width="100%" height="316" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td>&nbsp;</td>
  </tr>
</table>
<table border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="63" valign="top" background="resources/images/bgc10.gif" style="padding:30px 0px 0px 35px"><table width="93%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td><table border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td bgcolor="#8ac281" class="b06"><!--{$school.schoolname}--></td>
              <td><img src="resources/images/bgc11.gif" width="26" height="52" /></td>
            </tr>
        </table></td>
        <td align="right"><table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td height="23" align="right"><span class="b05"> 您好， </span><span class="b07"><!--{$school.schoolname}--></span><span class="b05"> 上次登录：</span><span class="b16"><!--{$user.last_login_date}--> </span><span class="b05">[<a href="<!--{spUrl c=main a=logout}-->">安全登出</a>]  [<a href="#" class="repwdLinkMy">密码修改</a>] </span></td>
            </tr>
            <tr>
              <td height="28" align="right" valign="bottom"><span class="b05"><a href="<!--{spUrl c=unit_school a=index}-->"> <img src="resources/images//c12.gif" width="97" height="21" /></a></span></td>
            </tr>
            <!--
            <tr>
              <td height="28" align="right" valign="bottom"><span class="b05"><img src="resources/images/c12.gif" width="97" height="21" /> <img src="resources/images/c11.gif" width="97" height="21" /></span></td>
            
            </tr>-->
        </table></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td background="resources/images//bgc02.gif"><table width="90%" border="0" align="center" cellpadding="0" cellspacing="0" style="margin-top:5px">
      <tr>
        <td width="56%" height="40"><img src="resources/images//bgc05.gif" align="absmiddle" /><span class="b01">信息导入</span></td>
        <td width="44%" align="right">&nbsp;</td>
      </tr>
      <tr>
        <td height="1" background="resources/images//bgc04.gif"></td>
        <td background="resources/images//bgc04.gif"></td>
      </tr>
    </table>
        <table width="90%" border="0" align="center" cellpadding="0" cellspacing="0" background="resources/images//bgc08.gif" style="margin:25px auto 15px auto">
          <tr>
            <td height="32" style="padding-left:15px"><table border="0" cellspacing="0" cellpadding="0">
                <tr>
                  <td><table border="0" cellpadding="0" cellspacing="0" class="b03">
                      <tr>
                        <td><a href="<!--{spUrl c=unit_import a=index}-->">相关制度</a></td>
                    </tr>
                  </table></td>
                  <td><table border="0" cellpadding="0" cellspacing="0" class="b03">
                <tr>
                        <td><a href="<!--{spUrl c=unit_import a=part2}-->">教学提升</a></td>
                    </tr>
                  </table></td>
                  <td><table border="0" cellpadding="0" cellspacing="0" class="b02">
                <tr>
                        <td><a href="#">活动PPT</a></td>
                    </tr>
                  </table></td>
                </tr>
            </table></td>
          </tr>
        </table>
        <table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">
          <tr>
            <td style="padding-left:15px"><span class="b05">最后更新：</span><span class="b10">2011</span><span class="b05"> 年</span><span class="b10">12 </span><span class="b05">月</span><span class="b10">13</span><span class="b05"> 日</span></td>
            <td align="right" style="padding-left:15px"><a href="<!--{spUrl c=export_tables a=index}-->"><img src="resources/images//cj125.gif" align="absmiddle" /></a></td>
          </tr>
        </table>
        <form action="<!--{spUrl c=unit_import a=addAction}-->" method="POST" id="addActionForm">
      <table border="0" align="center" cellpadding="0" cellspacing="0" style="margin:15px auto 25px auto">
          <tr>
            <td><img src="resources/images//ke15.gif" width="864" height="5" /></td>
          </tr>
          <tr>
            <td><table width="864" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#dfdfdf">

              <tr>
                <td width="856" bgcolor="#FFFFFF"><table width="85%" border="0" align="center" cellpadding="0" cellspacing="10" style="margin-top:5px">
                  <tr><td colspan="2"><span style="color: #096; font-weight: bold;">注意：请先选择活动日期。</span>
                  </td></tr>
                  <tr>
                    <td width="100" height="40" valign="top" style="padding-top:5px"><select name="r1" class="b11" id="r1">
                        <option value='-1'>--请选择活动类型--</option>
                        <!--{foreach from=$config02 item=one}-->
                        <option value="<!--{$one.id}-->" <!--{if $one.id==$data.r1}-->selected="selected"<!--{/if}-->><!--{$one.value}--></option>
                        <!--{/foreach}-->
                                          </select>
                    </td>
                    <td align="left"><table width="85%" border="0" cellpadding="0" cellspacing="0">
                        <tr>
                          <td width="101" height="30" align="right" class="b12">活动主题: </td>
                          <td width="423"><input name="theme" value="<!--{$data.theme}-->" type="text" class="b11" id="theme" size="50" /></td>
                        </tr>
                        <tr>
                          <td height="30" align="right" class="b12">教育目的: </td>
                          <td><select name="r3" class="b11" id="r3">
									
                            </select></td>
                        </tr>
                        <tr>
                          <td height="30" align="right" class="b12">活动对象: </td>
                          <td><select name="r4" class="b11" id="r4">
                              <option value="全校活动" <!--{if $data.r4=="全校活动"}-->selected="selected"<!--{/if}-->>全校活动</option>
                              <option value="住宿生" <!--{if $data.r4=="住宿生"}-->selected="selected"<!--{/if}-->>住宿生</option>
                              <option value="班级活动 <!--{if $data.r4=="班级活动"}-->selected="selected"<!--{/if}-->">班级活动</option>
                            </select>                          </td>
                        </tr>
                        <tr>
                          <td width="101" height="30" align="right" class="b12">参与人数: </td>
                          <td width="423"><input name="r5" value="<!--{$data.r5}-->" type="text" class="b11" id="r5" size="5" />
                            人</td>
                        </tr>
                        <tr>
                          <td height="30" align="right" class="b12">活动日期: </td>
                          <td><input name="cdate" value="<!--{$data.cdate}-->" class="b11" id="cdate" type="text" readonly="readonly">
                          </td>
                        </tr>
                        <tr>
                          <td height="30" align="right" class="b12">上传附件: </td>
                          <td><input name="filename" value="<!--{$data.filename}-->" type="text" class="b11" id="filename" size="45" style="margin-top: 10px;"  />
                          	  <input name="fullPath" type="hidden" id="fullPath" />
                              <div id="file-upload-1" style="float: right; margin-right: 100px; margin-top:-20px;" class="div-upload">	
                	   </div></td>
                        </tr>
                        <tr>
                          <td height="35" align="right" class="b12">&nbsp;</td>
                          <td><a href="#" class="submitForm"><img src="resources/images/ni.gif" width="66" height="19" /></a>
                         </td>
                          
                        </tr>
                    </table></td>
                  </tr>
                  <tr>
                    <td height="1" background="resources/images//cj21.gif"></td>
                    <td background="resources/images//cj21.gif"></td>
                  </tr>
                </table>
                </td>
              </tr>
            </table>
            </td>
          </tr>
          <tr>
            <td><img src="resources/images//ke14.gif" width="864" height="5" /></td>
          </tr>
      </table>
      </form>
    </td>
  </tr>
  <tr>
    <td><img src="resources/images//bgc03.gif" width="960" height="20" /></td>
  </tr>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="b04">
  <tr>
    <td height="80">&nbsp;</td>
  </tr>
</table>
</body>
</html>
